updating oE unlock_file

unlock_file

include io.e 
namespace io 
public procedure unlock_file(file_number fn, byte_range r = {}) 

unlock (a portion of) an open file.

Parameters:
  1. fn : an integer, the handle to the file or device to (partially) lock.
  2. r : a sequence, defining a section of the file to be locked, or {} for the whole file (the default).
Errors:

The target file or device must be open.

Comments:

You must have previously locked the file using lock_file. On Windows you can unlock a range of bytes within a file by specifying the r as {first_byte, last_byte}. The same range of bytes must have been locked by a previous call to lock_file. On Unix you can currently only lock or unlock an entire file. r should be {} when you want to unlock an entire file. On Unix, r must always be {}, which is the default.

You should unlock a file as soon as possible so other processes can use it.

Any files that you have locked, will automatically be unlocked when your program terminates.

See Also:

lock_file

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu